/**
 * chang
 */
define(function (require, exports, module) {
    var angular = require("angular");
    require("angular-interceptor");

    angular
        .module('ProductTypeService', ['ngInterceptor'])
        .service('productTypeList', ['$q', '$http', function ($q, $http) {
            return function (proId) {
                var defer = $q.defer();

                $http.get(window['G_CONFIG']['api_prefix'] + 'qmyx/para-setting/get-building-para-list', {params: {proId: proId}})
                    .success(function (res) {
                        if (res.retCode == 0) {
                            defer.resolve(res.data.DealProductType);
                        } else {
                            defer.reject();
                        }
                    })
                    .error(function () {
                        defer.reject();
                    })

                return defer.promise;
            };
        }])
});